load("//:build_variables.bzl", "COPTS")
load("//tools/lint:linters.bzl", "clang_tidy_test")

package(
    default_visibility = ["//:android_cuttlefish"],
)

cc_library(
    name = "libcvd",
    srcs = ["cvd.cpp" ],
    hdrs = ["cvd.h"],
    copts = COPTS + [ "-Werror=sign-compare" ],
    deps = [
        "//cuttlefish/common/libs/utils:environment",
        "//cuttlefish/common/libs/utils:flag_parser",
        "//cuttlefish/common/libs/utils:result",
        "//cuttlefish/host/commands/cvd/cli:command_request",
        "//cuttlefish/host/commands/cvd/cli:frontline_parser",
        "//cuttlefish/host/commands/cvd/cli:nesting_commands",
        "//cuttlefish/host/commands/cvd/instances",
        "//cuttlefish/host/commands/cvd/instances/lock",
        "//cuttlefish/host/commands/cvd/legacy:cvd_server_cc_proto",
        "//cuttlefish/host/commands/cvd/utils",
        "//libbase",
    ],
)

clang_tidy_test(
    name = "libcvd_clang_tidy",
    srcs = [":libcvd"],
    tags = ["clang_tidy", "clang-tidy"],
)

cc_binary(
    name = "cvd",
    srcs = ["main.cc" ],
    copts = COPTS,
    deps = [
        ":libcvd",
        "//cuttlefish/common/libs/utils:environment",
        "//cuttlefish/common/libs/utils:files",
        "//cuttlefish/common/libs/utils:flag_parser",
        "//cuttlefish/common/libs/utils:subprocess",
        "//cuttlefish/host/commands/cvd/legacy",
        "//cuttlefish/host/commands/cvd/utils",
        "//cuttlefish/host/commands/cvd/version",
        "//libbase",
        "//libsparse",
        "@fmt",
        "@protobuf",
    ],
)

clang_tidy_test(
    name = "cvd_clang_tidy",
    srcs = [":cvd"],
    tags = ["clang_tidy", "clang-tidy"],
)
